﻿using FluentNHibernate.Mapping;
using nsadv.Statistic.Domain;

namespace nsadv.Statistic.Repository.NHibernate.Config.Maps
{
	internal class UserMap : ClassMap<User>
	{
		public UserMap()
		{
			Table("Users");
			Not.LazyLoad();
			Id(x => x.Id)
				.Length(50)
				.GeneratedBy.Custom<Utils.IdentifierGenerator>();
			Map(x => x.Name);
			Map(x => x.Password);
			Map(x => x.Role);
			References<Place>(x => x.Place)
				.Column("PlaceId");
			References<Advertiser>(x => x.Advertiser)
				.Column("AgencyId");
		}
	}
}
